home *** CD-ROM | disk | FTP | other *** search
/ Micromanía 92 / CDMM92_1.ISO / SOF 2 SDK / sof2sdk-101.msi / _92D6AC311BB48EBA344BBABC89DA6AB0 / _810F716E51B34DCF9CBE6C814828112A < prev    next >
Encoding:
Text File  |  2002-06-05  |  4.1 KB  |  103 lines

  1. // Copyright (C) 2001-2002 Raven Software
  2. //
  3. /*****************************************************************************
  4.  * name:        be_ai_goal.h
  5.  *
  6.  * desc:        goal AI
  7.  *
  8.  * $Archive: /source/code/botlib/be_ai_goal.h $
  9.  * $Author: Mrelusive $ 
  10.  * $Revision: 2 $
  11.  * $Modtime: 10/05/99 3:32p $
  12.  * $Date: 10/05/99 3:42p $
  13.  *
  14.  *****************************************************************************/
  15.  
  16. #define MAX_AVOIDGOALS            256
  17. #define MAX_GOALSTACK            8
  18.  
  19. #define GFL_NONE                0
  20. #define GFL_ITEM                1
  21. #define GFL_ROAM                2
  22. #define GFL_DROPPED                4
  23.  
  24. //a bot goal
  25. typedef struct bot_goal_s
  26. {
  27.     vec3_t origin;                //origin of the goal
  28.     int areanum;                //area number of the goal
  29.     vec3_t mins, maxs;            //mins and maxs of the goal
  30.     int entitynum;                //number of the goal entity
  31.     int number;                    //goal number
  32.     int flags;                    //goal flags
  33.     int iteminfo;                //item information
  34. } bot_goal_t;
  35.  
  36. //reset the whole goal state, but keep the item weights
  37. void BotResetGoalState(int goalstate);
  38. //reset avoid goals
  39. void BotResetAvoidGoals(int goalstate);
  40. //remove the goal with the given number from the avoid goals
  41. void BotRemoveFromAvoidGoals(int goalstate, int number);
  42. //push a goal onto the goal stack
  43. void BotPushGoal(int goalstate, bot_goal_t *goal);
  44. //pop a goal from the goal stack
  45. void BotPopGoal(int goalstate);
  46. //empty the bot's goal stack
  47. void BotEmptyGoalStack(int goalstate);
  48. //dump the avoid goals
  49. void BotDumpAvoidGoals(int goalstate);
  50. //dump the goal stack
  51. void BotDumpGoalStack(int goalstate);
  52. //get the name name of the goal with the given number
  53. void BotGoalName(int number, char *name, int size);
  54. //get the top goal from the stack
  55. int BotGetTopGoal(int goalstate, bot_goal_t *goal);
  56. //get the second goal on the stack
  57. int BotGetSecondGoal(int goalstate, bot_goal_t *goal);
  58. //choose the best long term goal item for the bot
  59. int BotChooseLTGItem(int goalstate, vec3_t origin, int *inventory, int travelflags);
  60. //choose the best nearby goal item for the bot
  61. //the item may not be further away from the current bot position than maxtime
  62. //also the travel time from the nearby goal towards the long term goal may not
  63. //be larger than the travel time towards the long term goal from the current bot position
  64. int BotChooseNBGItem(int goalstate, vec3_t origin, int *inventory, int travelflags,
  65.                             bot_goal_t *ltg, float maxtime);
  66. //returns true if the bot touches the goal
  67. int BotTouchingGoal(vec3_t origin, bot_goal_t *goal);
  68. //returns true if the goal should be visible but isn't
  69. int BotItemGoalInVisButNotVisible(int viewer, vec3_t eye, vec3_t viewangles, bot_goal_t *goal);
  70. //search for a goal for the given classname, the index can be used
  71. //as a start point for the search when multiple goals are available with that same classname
  72. int BotGetLevelItemGoal(int index, char *classname, bot_goal_t *goal);
  73. //get the next camp spot in the map
  74. int BotGetNextCampSpotGoal(int num, bot_goal_t *goal);
  75. //get the map location with the given name
  76. int BotGetMapLocationGoal(char *name, bot_goal_t *goal);
  77. //returns the avoid goal time
  78. float BotAvoidGoalTime(int goalstate, int number);
  79. //set the avoid goal time
  80. void BotSetAvoidGoalTime(int goalstate, int number, float avoidtime);
  81. //initializes the items in the level
  82. void BotInitLevelItems(void);
  83. //regularly update dynamic entity items (dropped weapons, flags etc.)
  84. void BotUpdateEntityItems(void);
  85. //interbreed the goal fuzzy logic
  86. void BotInterbreedGoalFuzzyLogic(int parent1, int parent2, int child);
  87. //save the goal fuzzy logic to disk
  88. void BotSaveGoalFuzzyLogic(int goalstate, char *filename);
  89. //mutate the goal fuzzy logic
  90. void BotMutateGoalFuzzyLogic(int goalstate, float range);
  91. //loads item weights for the bot
  92. int BotLoadItemWeights(int goalstate, char *filename);
  93. //frees the item weights of the bot
  94. void BotFreeItemWeights(int goalstate);
  95. //returns the handle of a newly allocated goal state
  96. int BotAllocGoalState(int client);
  97. //free the given goal state
  98. void BotFreeGoalState(int handle);
  99. //setup the goal AI
  100. int BotSetupGoalAI(void);
  101. //shut down the goal AI
  102. void BotShutdownGoalAI(void);
  103.